package interview.friendlynumber;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class FriendlyNumber {
    public void execute() {
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s+");
        
        int N;
        N = sc.nextInt();
        
        long K;
        K = sc.nextLong();
        
        long[] unfriendly = new long[N];
        
        for(int i = 0; i < N; i++) {
            unfriendly[i] = sc.nextLong();
        }
        
        ArrayList<Long> factors = new ArrayList<Long>();
        
        Arrays.sort(unfriendly);
        
        int result = 0;
        for(long i = 1; i < Math.sqrt(K) + 1; i++) {
            if(K % i == 0) {
            	boolean found = false;
            	for(long f : factors) {
            		if(i < f && f % i == 0) {
            			found = true;
            			break;
            		}
            	}
            	
            	if(found) {
            		factors.add(i);
            		continue;
            	}
            	
            	long left = i;
            	long right = K / i;
            	int j = Arrays.binarySearch(unfriendly, left);
            	if(j < 0) {
            		j = -1 * (j + 1);
            	}
            	
                for(; j < N; j++) {
                    if(unfriendly[j] % left == 0) {
                        break;
                    }
                }
                if(j >= N) {
                    result++;
                }
                
                if(left != right) {
                	j = Arrays.binarySearch(unfriendly, right);
                	if(j < 0) {
                		j = -1 * (j + 1);
                	}
                	
                	for(; j < N; j++) {
                        if(unfriendly[j] % right == 0) {
                        	factors.add(right);
                            break;
                        }
                    }
                    if(j >= N) {
                        result++;
                    }
                }
                
            }
        }
        
        System.out.println(result);
    }
}